package com.gameloft.futbol;

import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Display;


/**
 * fMidlet represents the application's main class.
 *
 * @author demian
 * @version 0.1, 15/09/09
 */
public class fMidlet extends MIDlet
{
	
	/**
	 * The running instance of this class.
	 */
	public static fMidlet instance;
  
  
	/**
	 * Constructs a new application instance and starts another thread for
	 * the application's displayable.
	 */
  public fMidlet()
  {
    instance = this;
    new Thread(fCanvas.instance).start();
  }
  
	/**
	 * Start and resumes the application on system demand
	 */
  public void startApp()
  {
  	Display.getDisplay(this).setCurrent(fCanvas.instance);
  }
  
	/**
	 * Pauses the application on system demand
	 */
  public void pauseApp()
  {
    notifyPaused();
  }
  
	/**
	 * Destroy the application on system demand
	 * @param wether or not the application should be destroyed or it is allowed to continue
	 */
  public void destroyApp(boolean unconditional)
  {
    notifyDestroyed();
  }
  
}